<!DOCTYPE html>
<script src=../../resources/run-after-layout-and-paint.js></script>
<p>PASS if no crash (stack overflow)</p>
<svg>
  <pattern id="a" width="1" height="1">
    <rect fill="url(#b)" width="1" height="1"/>
  </pattern>
  <pattern id="b" xlink:href="#a"/>
  <rect fill="url(#b)" width="1" height="1"/>
</svg>
<script>
if (window.testRunner)
  testRunner.dumpAsText();
runAfterLayoutAndPaint(function() {}, true);
</script>
